package com.fst.dsi.lib.test;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;

import com.dnr.arch.kernel.Application;
import com.dnr.arch.kernel.KernelConstants;
import com.dnr.arch.kernel.KernelFactory;
import com.dnr.arch.kernel.model.MetaClass;
import com.fst.dsi.lib.domain.entity.Author;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
//		EntityManagerFactory emf = Persistence.createEntityManagerFactory("DataSource");
//		EntityManager em = emf.createEntityManager();
//		Query q = em.createQuery("select a from Book a");
//		List l = q.getResultList();
//		l.size();
//		Application.setEnv(KernelConstants.LOCAL_ENV);
//		Application.initialize();
//		Collection l = KernelFactory.getPersistenceDriver().executeQuery("select a from Book a");
		Author a = new Author();
		a.setId("1");
		a.setName("Test");
		//MetaClass c = new MetaClass("com.fst.dsi.lib.domain.entity.Book");
		MetaClass c = a.getMetaClass();
		Map m = c.getEntityFields();
		m.size();
//		l.size();
	}

}
